import React from "react";
import { Route, BrowserRouter as Router, Routes } from "react-router-dom";
import routerList from "./routerList";

export default class Routers extends React.Component {
    render() {
        return (
            <Router>
                <React.Suspense>
                    <Routes>
                        {routerList.map((item, index) => {
                            return (
                                <Route
                                    key={index}
                                    exact
                                    path={item.path}
                                    element={<item.component />}
                                />
                            )
                        })}
                    </Routes>
                </React.Suspense>
            </Router>
        )
    }
}